Create text completion from a single prompt .
cURL
curl --request POST \ --url https://api.anyapi.ai/v1/completions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "model": "<string>", "prompt": "<unknown>" } '
{ "id": "<string>", "object": "text_completion", "created": 123, "model": "<string>", "choices": [ { "text": "<string>", "index": 123, "finish_reason": "stop", "logprobs": { "tokens": [ "<string>" ], "token_logprobs": [ 123 ], "top_logprobs": [ {} ], "text_offset": [ 123 ] } } ], "usage": { "completion_tokens": 123, "prompt_tokens": 123, "total_tokens": 123 } }
Bearer token authentication. Get your API key from the dashboard.
ID of the model to use
The prompt(s) to generate completions for
Successful response
text_completion
Show child attributes
stop
length
content_filter
Number of tokens in the generated completion
Number of tokens in the prompt
Total number of tokens used in the request